class Car {
    String brand;
    double price;

    public Car() {
        System.out.println("Car 的空参构造器被调用");
    }

    public Car(String brand, double price) {
        this.brand = brand;
        this.price = price;
        System.out.println("Car 的全参构造器被调用");
    }
}

class Truck extends Car {
    double load;

    public Truck() {
        System.out.println("Truck 的空参构造器被调用");
    }

    public Truck(String brand, double price, double load) {
        super(brand, price);
        this.load = load;
        System.out.println("Truck 的全参构造器被调用");
    }
}
public class work08 {
    public static void main(String[] args) {
        System.out.println("实例化空参对象：");
        Truck truck1 = new Truck();

        System.out.println("\n实例化全参对象：");
        Truck truck2 = new Truck("Toyota", 30000.0, 5000.0);
    }
}
